package com.culture.java.online.education.platform.data.demo.validate;

import com.culture.java.online.education.platform.data.demo.validate.handler.BirthdayAgeValidatedHandler;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = BirthdayAgeValidatedHandler.class)
public @interface BirthdayAgeValidated {

    String message() default "出生日期和年龄不匹配！";

    // 分组校验
    Class<?>[] groups() default { };

    // 校验等级
    Class<? extends Payload>[] payload() default { };

}
